<?php

namespace app\model;

use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;

class DistrictService extends Base
{

    protected $table = "district_service";


    protected $connection;


    public function __construct(array $attributes = [])
    {
        parent::__construct($attributes);
        $this->connection = config('database.connections.biqi_game.database');
    }


    public function TestAreaConfig(): BelongsTo
    {
        return $this->belongsTo(DistrictServiceConfig::class, 'test_area', 'ulid');
    }

    public function OfficialAreaConfig(): BelongsTo
    {
        return $this->belongsTo(DistrictServiceConfig::class, 'official_area', 'ulid');
    }


    public function Server(): BelongsTo
    {
        return $this->belongsTo(Server::class, 'server', 'ulid');
    }


    public function LanderService(): HasOne
    {
        return $this->hasOne(LanderService::class, 'district_service', 'ulid');
    }

}
